package ACM;

import java.util.Scanner;

public class Main_04 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNext()) {
            int num = scanner.nextInt();
            int sum = 0;
            if (num == 0) break;
            for (int i = 0; i < num; i++) {
                sum = sum + scanner.nextInt();
            }
            System.out.println(sum);
        }
    }
}
